using UnityEngine;

public class GoldenEgg : MonoBehaviour
{
	public int gold;

	public AudioClip pickupAudio;

	private void Update()
	{
		if ((bool)CampaignGame.Instance.player && Vector2.Distance(CampaignGame.Instance.player.transform.position, base.transform.position) < 0.5f)
		{
			CampaignGame.Instance.player.audioSource.PlayOneShot(pickupAudio);
			DO.Player.gold += gold;
			Object.Destroy(base.gameObject);
		}
	}
}
